+2008-09-17 Matthias Clasen <mclasen@redhat.com>
+
+ Bug 329593 – Entering characters on a line very cpu intensive and
+ slow
+
+ * gtk/gtknotebook.c (gtk_notebook_page_allocate): Return a boolean
+ that indicates whether the tab allocation has changed.
+ (gtk_notebook_pages_allocate): Only redraw the tabs if their
+ allocation has changed.
+ (gtk_notebook_calculate_tabs_allocations): Remove unused return value.
+ Patch by Owen Taylor
+
2008-09-17 Matthias Clasen <mclasen@redhat.com>
Bug 408154 – [PATCH] Change GtkEntryCompletion max-items to style
/*** GtkNotebook Size Allocate Functions ***/
static void gtk_notebook_pages_allocate (GtkNotebook *notebook);
-static void gtk_notebook_page_allocate (GtkNotebook *notebook,
+static gboolean gtk_notebook_page_allocate (GtkNotebook *notebook,
GtkNotebookPage *page);
static void gtk_notebook_calc_tabs (GtkNotebook *notebook,
GList *start,
return FALSE;
}
-static gboolean
+static void
gtk_notebook_calculate_tabs_allocation (GtkNotebook *notebook,
GList **children,
GList *last_child,
gint xthickness, ythickness;
gboolean gap_left, packing_changed;
GtkAllocation child_allocation = { 0, };
- gboolean allocation_changed = FALSE;
widget = GTK_WIDGET (notebook);
container = GTK_CONTAINER (notebook);
break;
}
- if ((priv->operation != DRAG_OPERATION_REORDER || page != notebook->cur_page) &&
- (page->allocation.x != child_allocation.x ||
- page->allocation.y != child_allocation.y ||
- page->allocation.width != child_allocation.width ||
- page->allocation.height != child_allocation.height))
- allocation_changed = TRUE;
-
page->allocation = child_allocation;
if ((page == priv->detached_tab && priv->operation == DRAG_OPERATION_DETACH) ||
break;
}
}
-
- return allocation_changed;
}
static void
gboolean showarrow = FALSE;
gint tab_space, min, max, remaining_space;
gint expanded_tabs, operation;
+ gboolean tab_allocations_changed = FALSE;
if (!notebook->show_tabs || !notebook->children || !notebook->cur_page)
return;
while (children)
{
- gtk_notebook_page_allocate (notebook, GTK_NOTEBOOK_PAGE (children));
+ if (gtk_notebook_page_allocate (notebook, GTK_NOTEBOOK_PAGE (children)))
+ tab_allocations_changed = TRUE;
children = children->next;
}
if (!notebook->first_tab)
notebook->first_tab = notebook->children;
- gtk_notebook_redraw_tabs (notebook);
+ if (tab_allocations_changed)
+ gtk_notebook_redraw_tabs (notebook);
}
-static void
+static gboolean
gtk_notebook_page_allocate (GtkNotebook *notebook,
GtkNotebookPage *page)
{
gint focus_width;
gint tab_curvature;
gint tab_pos = get_effective_tab_pos (notebook);
+ gboolean tab_allocation_changed;
if (!page->tab_label)
- return;
+ return FALSE;
xthickness = widget->style->xthickness;
ythickness = widget->style->ythickness;
break;
}
+ tab_allocation_changed = (child_allocation.x != page->tab_label->allocation.x ||
+ child_allocation.y != page->tab_label->allocation.y ||
+ child_allocation.width != page->tab_label->allocation.width ||
+ child_allocation.height != page->tab_label->allocation.height);
+
gtk_widget_size_allocate (page->tab_label, &child_allocation);
+
+ return tab_allocation_changed;
}
static void